package com.glx.learn_spring.learn_spring_02_baseconfig;

import com.glx.learn_spring.learn_spring_02_baseconfig.dao.IBookDao;
import com.glx.learn_spring.learn_spring_02_baseconfig.service.IBookService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AppForName {
    public static void main(String[] args) {
        // 获取 上下文
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        // 获取 bean
        //IBookService bookService = ctx.getBean("bookServiceId2", IBookService.class);
        IBookService bookService = ctx.getBean("bookServiceImpl", IBookService.class);
        bookService.save();
    }
}
